import java.util.Arrays;

public class GenericArray<E extends Comparable> {
    private Object[] array = new Object[10];

    public void setValue(int pos, E val)
    {
        array[pos]=val;
    }
    public E getValue(int pos){return (E)array[pos];}


}
class Alg{
    public <E extends Comparable>E findMax(E[] array){
        E max = array[0];
        for (int i = 1; i < array.length; i++) {
            if (array[i].compareTo(max)<0) {
                max = array[i];
            }
        }
        return max;
    }
}
class Test01{
    public static void main(String[] args) {
        Double[] arr = new Double[10];
        for (int i = 0; i < 10; i++) {
           arr[i]=Math.random();
        }
        System.out.println(Arrays.toString(arr));
        Alg alg = new Alg();
        System.out.println(alg.<Double>findMax(arr));
    }
}
